package com.example.demo1.controller;

import com.example.demo1.utils.DetectionResult;
import com.example.demo1.entity.Timepoint;
import com.example.demo1.service.DataDetectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/detect")
public class DetectionController {


      @Resource
      private DataDetectionService dataDetectionService;
      //返回感染率数据
      @PostMapping("/result")
      public  List<DetectionResult> Resultdata(@RequestBody List<Timepoint> timepoints) throws Exception {
         List<DetectionResult>  results= dataDetectionService.DataDetection(timepoints);
         //后续变化趋势，如果只要一个组的结果在这里改
                return results;
        }




}
